home *** CD-ROM | disk | FTP | other *** search
/ 1,000+ Great Games / 1_1000 Games.iso / DOSGAMES / BOGGLE.ZIP / SOURCE.ZIP / WLIST.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-07  |  2.6 KB  |  76 lines

  1. /*****************************************************************************
  2. * Program:  WLIST.CPP
  3. * Purpose:  This module handles the events associated with the word list 
  4. *           list box.
  5. *****************************************************************************/
  6. #include  "bogwin.hpp"
  7.  
  8.  
  9. /*****************************************************************************
  10. * Function: TBogWordList 
  11. * Parms:    parms for the parent and style of list box
  12. * Purpose:  Constructor for the list box
  13. * Returns:  Nothing
  14. *****************************************************************************/
  15. TBogWordList::TBogWordList (unsigned long id,
  16.                            IWindow* parent)
  17.       : IListBox(id, parent, parent, 
  18.                    IRectangle(), 
  19.                    defaultStyle() | multipleSelect)
  20. {
  21.  
  22. }
  23.  
  24. /*****************************************************************************
  25. * Function: addString
  26. * Parms:    sString - string to add to the list box
  27. * Purpose:  Adds a string to the list box
  28. * Returns:  Nothing
  29. *****************************************************************************/
  30. void TBogWordList::addString(char *sString)
  31. {
  32.    /********************************************************
  33.    * Here we must add the string to the list box.
  34.    ********************************************************/
  35.    addAscending(sString);
  36. }
  37.  
  38.  
  39. /*****************************************************************************
  40. * Function: clearList
  41. * Parms:    none
  42. * Purpose:  removes all the words from the list box
  43. * Returns:  Nothing
  44. *****************************************************************************/
  45. void TBogWordList::clearList()
  46. {
  47.    removeAll();
  48. }
  49.  
  50. /*****************************************************************************
  51. * Function: selectAll
  52. * Parms:    none
  53. * Purpose:  removes all the words from the list box
  54. * Returns:  Nothing
  55. *****************************************************************************/
  56. void TBogWordList::selectAllWords()
  57. {
  58.    if(!isEmpty())
  59.       selectAll();  //part of the IBM class library
  60. }
  61.  
  62.  
  63. /*****************************************************************************
  64. * Function: selectWord
  65. * Parms:    index - particular word in the listbox you wish to hilight
  66. * Purpose:  shows whats has been already guessed
  67. * Returns:  Nothing
  68. *****************************************************************************/
  69. void TBogWordList::selectWord(int index)
  70. {
  71.  
  72. //Show the word that was already selected
  73.    select(index, TRUE);                       //show their error
  74.    setTop(index);
  75. }
  76.